package com.geline.mybatisplus.interceptor.inner;

import com.geline.mybatisplus.annotation.LogCarry;
import com.geline.mybatisplus.handler.LogCarryHandler;
import com.geline.mybatisplus.interceptor.EntityInterceptor;
import lombok.extern.slf4j.Slf4j;

/**
 * 日志收集注解拦截器 @LogCarry
 *
 * @author: mx
 * @date: 2024-08-17 15:02
 */
@Slf4j
public class LogCarryInterceptor extends EntityInterceptor<LogCarry> {

    private LogCarryHandler logCarryHandler;

    public LogCarryInterceptor(LogCarryHandler logCarryHandler){
        this.logCarryHandler = logCarryHandler;
    }

    @Override
    public void handleInsert(LogCarry annotation, Object entity) {
        logCarryHandler.handleInsert(annotation, entity);
    }

    @Override
    public void handleUpdate(LogCarry annotation, Object entity) {
        logCarryHandler.handleUpdate(annotation, entity);
    }

    @Override
    public void handleDelete(LogCarry annotation, Object entity) {
        logCarryHandler.handleDelete(annotation, entity);
    }
}
